import $consts from '@/common/consts'

const index = {
  state: {
    commonConfig: {}, // 公共配置
    pageIndex: $consts.INDEX_BOTTOM_TAB.TOOLS // 首页底部tabbar当前选中项
  },
  mutations: {
    setCommonConfig(state, commonConfig) { // 公共配置
      if (commonConfig) { state.commonConfig = commonConfig }
    },
    setPageIndex(state, pageIndex) { // 首页tab切换展示页面
      state.pageIndex = pageIndex
    }
  },
  actions: {},
  getters: {
    getCommonConfig: (state) => state.commonConfig,
    getPageIndex: (state) => state.pageIndex
  }
}

export default index

